﻿// License: MS-PL
// Based heavily on demo code that is part of http://msdn.microsoft.com/en-us/magazine/dd419663.aspx .
// Has been modified to fit coding style of MachineQA project. Only comments and the namespace have been changed.
using System;
using System.Windows.Input;

namespace MachineQA.ViewModel
{
    /// <summary>
    /// Incapsulates a command providing a displayName property inheritented from ViewModelBase so that
    /// the command needed for a view can be determined based on the name of the command.
    /// </summary>
    public class CommandViewModel : ViewModelBase
    {
        public CommandViewModel(string displayName, ICommand command)
        {
            if (command == null)
                throw new ArgumentNullException("command");

            base.DisplayName = displayName;
            this.Command = command;
        }

        public ICommand Command { get; private set; }
    }
}
